<?php

namespace core\db;

class Mysql
{
    private $cfg;

    public static $connect;

    public function __construct($host, $user, $passwd, $dbname)
    {
        $con = mysqli_connect($host, $user, $passwd, $dbname);

        // 检查连接
        if (!$con) {
            die('连接错误: ' . mysqli_connect_error());
        }

        self::$connect = $con;
    }

    public function getConnection()
    {
        return self::$connect;
    }
}
